package com.ccys.db.mapper;

import com.ccys.db.dto.CommonDto;
import com.ccys.db.dto.userManagement.TblMemberDTO;
import com.ccys.db.entity.TblMember;
import com.ccys.db.vo.doctor.login.ProfileVo;
import com.ccys.db.vo.doctor.patientHistory.BookingInfoVo;
import com.ccys.db.vo.doctor.pendingToConsult.MemberDetailVo;
import com.ccys.db.vo.doctor.postConsult.MemberDeviceInfoVo;
import com.ccys.db.vo.doctor.postConsult.MemberInfoVo;
import com.ccys.db.vo.member.*;
import com.ccys.db.vo.userManagement.TblMemberDetailWebVO;
import com.ccys.db.vo.userManagement.TblMemberWebVO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;

import java.util.List;

/**
 * Created by Mybatis Generator on 2023/12/18
 */
public interface TblMemberMapper extends Mapper<TblMember>, MySqlMapper<TblMember> {
    List<TblMember> findListByEmailMatchingPattern(@Param("emailMatchingPattern") String emailMatchingPattern);

    List<TblMemberWebVO> listObjectsCms(TblMemberDTO dto);

    /**
     * @description cms-用户管理 查询详情
     * @date 2023/12/20
     * @author cloud fly
     */
    TblMemberDetailWebVO getMemberDetail(TblMemberDTO dto);

    /**
     * @description 查询可选择用户列表
     * @date 2023/12/23
     * @author cloud fly
     */
    List<TblMemberWebVO> listSelect(TblMemberDTO dto);

    /**
     * @description 更新激活账号
     * @date 2024/1/24
     * @author cloud fly
     */
    int updateActivateAccount(@Param("id") String id);

    /**
     * @description 激活账号返回信息
     * @date 2024/1/24
     * @author cloud fly
     */
    ActivateAccountVO getActivateAccountInfo(@Param("id") String id);

    /**
     * @description 激活pinCode
     * @date 2024/1/25
     * @author cloud fly
     */
    int updateActivatePincode(@Param("id") String id);

    /**
     * @description 查询用户电子卡片列表
     * @date 2024/1/26
     * @author cloud fly
     */
    List<MemberECardVO> getMemberECardList(CommonDto dto);

    /**
     * @description 查询预约历史记录
     * @date 2024/1/28
     * @author cloud fly
     */
    List<AppointmentHistoriesVO> getAppointmentHistories(CommonDto dto);

    /**
     * @description getMemberInfo  查询member详情 TODO  具体需要哪些字段待处理
     * @date 2024/1/31
     * @author cloud fly
     */
    MemberInfoDetailVO getMemberInfoDetailVO(@Param("id") String id);


    Integer getPinCodeInfo(@Param("memberId") String memberId);

    Integer findCheckByEmail(@Param("memberId") String memberId, @Param("email") String email);

    Integer findCheckByNricFin(@Param("memberId") String memberId,@Param("nricFin") String nricFin);

    Integer findCheckByPhone(@Param("memberId") String memberId,@Param("phone") String phone);

       /**
        * @description 查询用户配送地址
        * @date     2024/2/4
        * @author   cloud fly
        */
    List<DeliveryAddressInfoVO> getDeliveryAddressInfo(CommonDto dto);

    TblMember findById(@Param("memberId") String memberId);


    /**
     * 查询用户device信息
     * @param bookingId bookingId
     * @return
     * @author xly
     */
    MemberDeviceInfoVo getDeviceInfoByBookingId(String bookingId);

    /**
     * 查询正在问诊mem信息
     * @param memberId
     * @return
     */
    ProfileVo.ActiveBookingMember selectActiveBookingMember(@Param("memberId")String memberId);

    /**
     * 查询bookingInfo中的member信息
     * @param memberId
     * @return
     */
    BookingInfoVo.Member selectBookingInfoMember(@Param("memberId")String memberId);

    /**
     * 查询正在问诊小孩信息
     * @param childId
     * @return
     */
    ProfileVo.ActiveBookingChild selectActiveBookingChild(@Param("childId")String childId);

    /**
     * 查询bookingInfo中的child信息
     * @param childId
     * @return
     */
    BookingInfoVo.Child selectBookingInfoChild(@Param("childId")String childId);

    /**
     * 根据bookingId 查询 memberInfo
     * @param bookingId bookingId
     * @return memberInfo
     */
    MemberInfoVo getMemberInfoByBookingId(String bookingId);


    MemberDetailVo getMemberInfoByMemberId(String memberId);
}
